-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix conflicting TADDR definition #98925
Conversation
@@ -206,7 +206,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat | |||
|
|||
#endif // TARGET_UNIX | |||
|
|||
#define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContextPointers->regname = m_MachState.m_Ptrs.p##regname; | |||
#define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContextPointers->regname = (DWORD64 *)(TADDR *)m_MachState.m_Ptrs.p##regname; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels pretty ugly, but uint64_t
(& DWORD64
) is defined as unsigned long long
and uintptr_t
(& TADDR
) is defined as unsigned long
, at least on osx-x64.
@@ -206,7 +206,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat | |||
|
|||
#endif // TARGET_UNIX | |||
|
|||
#define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContextPointers->regname = m_MachState.m_Ptrs.p##regname; | |||
#define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContextPointers->regname = (DWORD64 *)(TADDR *)m_MachState.m_Ptrs.p##regname; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContextPointers->regname = (DWORD64 *)(TADDR *)m_MachState.m_Ptrs.p##regname; | |
#define CALLEE_SAVED_REGISTER(regname) pRD->pCurrentContextPointers->regname = (DWORD64 *)m_MachState.m_Ptrs.p##regname; |
Is this enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, doesn’t work. It’s typed as the __DPtr
class and it doesn’t have the cast operator to make that work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
osx-x64 with single cast:
/Users/filipnavara/Projects/runtime/src/coreclr/vm/amd64/cgenamd64.cpp:210:5: error: cannot cast from type 'PTR_TADDR' (aka '__DPtr<unsigned long>') to pointer type 'DWORD64 *' (aka 'unsigned long long *')
ENUM_CALLEE_SAVED_REGISTERS();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/filipnavara/Projects/runtime/src/coreclr/vm/amd64/cgencpu.h:182:5: note: expanded from macro 'ENUM_CALLEE_SAVED_REGISTERS'
CALLEE_SAVED_REGISTER(R12) \
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/filipnavara/Projects/runtime/src/coreclr/vm/amd64/cgenamd64.cpp:209:80: note: expanded from macro 'CALLEE_SAVED_REGISTER'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
Follow up on #97751, which broke win-x86 NAOT build